package com.xzy.es.common.util;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * ES工具类
 *
 * @author xzy
 * @date 2021/10/2110:35
 */
public class ESUtil {

    /**
     * 获取ES客户端
     *
     * @return - ES客户端
     */
    public static RestHighLevelClient getESClient() {
        return new RestHighLevelClient(
                RestClient.builder(new HttpHost("127.0.0.1", 9200, "http"))
        );
    }
}
